#include <stdio.h>


int main()
{
	char num[20]={0};
	fgets(num,sizeof(num),stdin);
	int i;
	int count1=0;
	int count2=0;
	int count3=0;
	int count4=0;
	for(i=0;num[i]!='\0';i++)
	{
		if(num[i]=='\n')
		break;
		else if(num[i]>='a' && num[i]<='z')
		{
			count1++;
		}
		else if(num[i]>='A' && num[i]<='Z')
		{
			count1++;
		}
		else if(num[i]==' ')
		{
			count2++;
		}
		else if(num[i]>='0' && num[i]<='9')
		{
			count3++;
		}
		else
			count4++;
	}
	printf("%d\n%d\n%d\n%d\n",count1,count2,count3,count4);
	return 0;
}